// 标记角色类型
class RoleInfoEntity {
  // 主案设计师
  static const int userTypeDesigner = 1;

  // 定制设计师
  static const int customizedDesigner = 2;

  // 施工顾问
  static const int userTypeSupervisor = 4;

  // 电商客服
  static const int eCommerceCS = 8;

  // 电商运营
  static const int eCommerceOperator = 9;

  // 管理员
  static const int admin = 10;

  // 量房员
  static const int userTypeSurveyor = 12;

  // 客服
  static const int userTypeCustomerService = 13;

  // 工人
  static const int userTypeWorker = 14;

  // 工长
  static const int userTypeForeman = 15;

  // 材料顾问
  static const int materialStaff = 16;

  // 设计师
  static const int designer = 11;

  // 管家
  static const int butler = 17;

  // 设计顾问
  static const int designConsultant = 18;

  // 调度员
  static const int equipmentStaff = 19;

  // 其他人员
  static const int otherStaff = 20;

  // 定制材料顾问
  static const int woodConsultantStaff = 21;

  // 内容管理员
  static const int contentAdminStaff = 22;

  /// 根据id匹配对应的角色名
  static String matchRoleNameByType(int type) {
    String name = '';
    switch (type) {
      case userTypeDesigner:
        name = '设计师';
        break;
      case customizedDesigner:
        name = '定制设计师';
        break;
      case userTypeSupervisor:
        name = '施工顾问';
        break;
      case eCommerceCS:
        name = '电商客服';
        break;
      case eCommerceOperator:
        name = '电商运营';
        break;
      case admin:
        name = '管理员';
        break;
      case userTypeSurveyor:
        name = '量房员';
        break;
      case userTypeCustomerService:
        name = '客服';
        break;
      case userTypeWorker:
        name = '工人';
        break;
      case materialStaff:
        name = '材料顾问';
        break;
      case butler:
        name = '管家';
        break;
      case designConsultant:
        name = '设计顾问';
        break;
      case equipmentStaff:
        name = '调度员';
        break;
      case otherStaff:
        name = '其他人员';
        break;
      case woodConsultantStaff:
        name = '定制材料顾问';
        break;
      case contentAdminStaff:
        name = '内容管理员';
        break;
      case designer:
        name = '设计师';
        break;
    }
    return name;
  }

  int? acceptStatus;
  int? id;
  String? name;
  int? type;

  RoleInfoEntity({this.acceptStatus, this.id, this.name, this.type});

  RoleInfoEntity.fromJson(Map<String, dynamic> json) {
    acceptStatus = json['acceptStatus'];
    id = json['id'];
    name = json['name'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['acceptStatus'] = this.acceptStatus;
    data['id'] = this.id;
    data['name'] = this.name;
    data['type'] = this.type;
    return data;
  }
}
